package com.tpp.service;

import com.tpp.entity.*;
import com.tpp.mapper.FilmMapper;
import com.tpp.util.Result;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.sql.Date;
import java.util.List;

@Service
public class FilmService {
    @Autowired
    private FilmMapper filmMapper;
    public Film GetFilmInfo(String Film_name){
        Film film = null;
        film=filmMapper.GetFilmInfo(Film_name);
        return film;
    }
    public Date[] FindAFilmTimeByCinema(String cinema,String filmTitle){
        Date[] dates=filmMapper.FindAFilmTimeByCinema(cinema,filmTitle);
        return dates;
    }
    public List<FilmTime> FindAFilmTimeByDate(Date date, String Film_name){
        List<FilmTime> filmTime=filmMapper.FindAFilmTimeByDate(date,Film_name);
        return filmTime;
    }
    public List<FilmTime> FindAFilmTimeByTitle( String Film_name){
        List<FilmTime> filmTime=filmMapper.FindAFilmTimeByTitle(Film_name);
        return filmTime;
    }
    public  List<FilmItemShow> FindForthcomingFilms(){
        return filmMapper.FindForthcomingFilms();
    }
    public  List<FilmItemShow> findOnlineFilms(){
        return filmMapper.findOnlineFilms();
    }
    public  List<FilmItemShow> findAllForthcomingFilms(){
        return filmMapper.findAllForthcomingFilms();
    }
    public  List<FilmItemShow> findAllOnlineFilms(){
        return filmMapper.findAllOnlineFilms();
    }
    public String findSeatInfoByTimesId(int time_id){
        return filmMapper.findSeatInfoByTimesId(time_id);
    }


    public  List<Film> findAllOnlineFilms_wx(){
        return filmMapper.findAllOnlineFilms_wx();
    }
    public  List<Film> findAllforthcomingFilms_wx(){
        return filmMapper.findAllforthcomingFilms_wx();
    }
    public Film getFilmInfoById_wx( int film_id){
        return filmMapper.getFilmInfoById_wx(film_id);
    }
    public List<Order> getOrderInfoByUsername_wx( String username){
        return filmMapper.getOrderInfoByUsername_wx(username);
    }
    public List<FilmTime>getAllTimesByFilmName_wx(String filmName){
        return filmMapper.getAllTimesByFilmName_wx(filmName);
    }
    public String getSeatInfoByTimeId_wx(int timeId){
        return filmMapper.getSeatInfoByTimeId_wx(timeId);
    }

}
